<div class="artCon">
	<div class="middleArt">
	<form class="form-horizontal" id="useraddForm" action="/${orgi}/design/custom/${reportid!''}/${modelid!''}/filtereditdo.html" data-target="#filterlist_div" data-toggle="ajax-form" method="post">
		<input value="${filter.id!''}" name="id" type="hidden">
		<input value="${filter.code!''}" name="code" type="hidden">
		<input value="${filter.dataid!''}" name="dataid" type="hidden">
		<input value="${filter.dimid!''}" name="dimid" type="hidden">
		<input value="${filter.funtype!'filter'}" name="funtype" type="hidden">
		<input value="${filter.contype!'dimension'}" name="contype" type="hidden">
		<input value="${filter.dataname!''}" name="dataname" type="hidden">
		<div class="artMain">
			<div class="mainCenter" style="margin-left: 20px; margin-right: 20px">
				<table class="data_table_1" >
					<tr>
						<th>显示名称（<a href="javascript:void(0)" id="color_a">${filter.name!''}</a>）：</th>
						<td>
						<input type="text" class="required span2"  value="${filter.name!''}" name="name">
						<span class="help-inline"></span><i class="inputip">*</i>
						</td>
						
					</tr>
					<tr>
						<th>选择方式：</th>
						<td>
							<select id="select_modeltype" class="span2" name="modeltype" onclick="if($(this).val() == 'date'){$('#dateformatdiv').show();}else{$('#dateformatdiv').hide();}">
								<option value="text" <#if filter.modeltype?? && filter.modeltype == 'text'>selected="selected"</#if>>文本框</option>
								<option value="date" <#if filter.modeltype?? && filter.modeltype == 'date'>selected="selected"</#if>>日历</option>
								<option value="sigsel" <#if filter.modeltype?? && filter.modeltype == 'sigsel'>selected="selected"</#if>>单选下拉列表</option>
								<option value="select" <#if filter.modeltype?? && filter.modeltype == 'select'>selected="selected"</#if>>多选下拉列表</option>
							</select>
						</td>
						<th>取值方式：</th>
						<td>
						<select onclick="if($(this).val() == 'auto'){if($('#select_modeltype').val()=='sigsel')$('#cascade_tr').show();}else{$('#cascade_tr').hide();}" class="span2" name="convalue">
							<option value="input" <#if filter.convalue?? && filter.convalue == 'input'>selected="selected"</#if>>用户输入</option>
							<option value="auto" <#if filter.convalue?? && filter.convalue == 'auto'>selected="selected"</#if>>自动获取</option>
							<!--<option value="userdef" <#if filter.convalue?? && filter.convalue == 'userdef'>selected="selected"</#if>>自定义</option>-->
						</select>
						</td>
					</tr>
					<tr>
						<th>条件类型：</th>
						<td>
						<select name="valuefiltertype" class="span2" onchange="if($(this).val()=='compare'){$('#rangevalue').hide();$('#comparevalue').show();}else{$('#rangevalue').show();$('#comparevalue').hide();}">
							<option value="compare" <#if filter.valuefiltertype?? && filter.valuefiltertype == 'compare'>selected="selected"</#if>>比较</option>
							<option value="range" <#if filter.valuefiltertype?? && filter.valuefiltertype == 'range'>selected="selected"</#if>>范围</option>
						</select>
						</td>

						<th>比较方式：</th>
						<td>
						
						<select name="comparetype"  class="span2">
							<option value="equal" <#if filter.comparetype?? && filter.comparetype == 'equal'>selected="selected"</#if>>相等（IN）</option>
							<option value="not" <#if filter.comparetype?? && filter.comparetype == 'not'>selected="selected"</#if>>不等（NOT IN）</option>
						</select>
						
						</td>
					</tr>
					<tr> 						
						<th>默认值：</th>
						<td>
							<div id="rangevalue" style="<#if filter.valuefiltertype?? && filter.valuefiltertype != 'range'>display:none;</#if>">
								<table class="data_table_1" >
									<tr>
										<th style="padding-right:5px;"><input type="text"  class="span1" name="startvalue" value="${filter.startvalue!''}"></th>
										<td style="width:20px;padding:0px;">到：</td>
										<td style="padding:0px;"><input type="text"  class="span1" name="endvalue" value="${filter.endvalue!''}"></td>
									</tr>
								</table>
							</div>
							<div id="comparevalue" style="<#if filter.valuefiltertype?? && filter.valuefiltertype != 'compare'>display:none;</#if>">
								<table class="data_table_1" >
									<tr>
										<th><input type="text"  class="span2" name="defaultvalue" value="${filter.defaultvalue!''}"></td>
									</tr>
								</table>
							</div>
							
						</td>
						<td colspan="2">
							<div id="dateformatdiv" style="<#if filter.modeltype?? && filter.modeltype != 'date'>display:none;</#if>">
								<table class="data_table_1" >
									<tr>
										<th>日历格式：</th>
										<td><input type="text" class="span2" name="formatstr" value='${filter.formatstr!"yyyy-MM-dd"}'></td>
									</tr>
								</table>
							</div>
						</td>
					</tr>
					<!-- <tr>
						<th>前缀：</th>
						<td>
						
						<input type="text" class="span2" name="filterprefix" value="${filter.filterprefix!''}">
						
						</td>
						<th>后缀：</th>
						<td>
						 <input type="text" class="span2" name="filtersuffix" value="${filter.filtersuffix!''}">
						</td>
					</tr> -->
					
					<tr>
						<th>必填项：</th>
						<td>
						
						<label><input type="radio" class="" name="mustvalue" <#if filter.mustvalue?? && filter.mustvalue == 'mustvalue'>checked="checked"</#if> value="mustvalue">是</label>
						<label><input type="radio" class="" name="mustvalue" <#if !filter.mustvalue??||(filter.mustvalue?? && filter.mustvalue != 'mustvalue')>checked="checked"</#if> value="">否</label>
						
						</td>
						<th>&nbsp;</th>
						<td>
						 &nbsp;
						</td>
					</tr>
					<#if groups?? && groups?size gt 0>
					<tr>
						<th>分组:</th>
						<td colspan="4">
							<div>
							<#list groups as group>
								<label><input <#if filter.groupids?? && filter.groupids?index_of('${group.id}') !=-1>checked="checked"</#if> type="checkbox" value="${group.id!''}" name="groupids"/>${group.name!''}</label>
							</#list>
							</div>
						</td>
					</tr>
					</#if>
					<tr id="cascade_tr" style="<#if filter.convalue?? && filter.modeltype?? && filter.convalue != 'auto' && filter.modeltype != 'sigsel'>display:none;</#if>">
						<th>级联:</th>
						<td colspan="4">
							<div id="filter_mdx">
							<select name="cascadeid"  class="span4">
								<option value="">请选择...</option>
								<#if filters??>
									<#list filters as ft>
										<option value="${ft.id!''}" <#if filter.cascadeid?? && filter.cascadeid == ft.id>selected="selected"</#if>>${ft.name!''}</option>
									</#list>
								</#if>
								
							</select>
							</div>
						</td>
					</tr>
					
				</table>
			</div>
		</div>
		<div class="bottomBg">
			<div class="btnWrap">
				<input type="submit" class="subButtonStyle" value="确认"/>
				<input type="button" onclick="closeR3ArtDialog()" class="cancelButtonStyle" value="取消"/>
			</div>
		</div>
		</form>
	</div>
</div>
<script type="text/javascript">
	$(function(){
		$(".mainCenter ul li").hover(function(){
			$(this).addClass("cur").siblings("li").removeClass("cur");
		},function(){
			$(this).removeClass("cur");	
		});
	})
	
</script>
